from socket import *
import threading

uname = input('请输入用户名：')

s = socket()

ip = gethostname()
port = 8080

s.connect((ip, port))

s.send(uname.encode('utf-8'))


def recv_msg(s):
    content = s.recv(2048).decode('utf-8')
    print(content)





threading.Thread(target=recv_msg, args=(s,)).start()

while True:
    data = input()
    s.send(data.encode('utf-8'))




















































